package panda.query.tree;

import java.util.List;

import panda.query.scan.DistinctScanner;
import panda.query.scan.Scanner;
import panda.query.struct.Attribute;
import panda.record.Schema;
import panda.transaction.Transaction;

public class DistinctNode implements QueryTreeNode {
	
	QueryTreeNode n;
	Transaction tx;
	List<Attribute> attrs;
	
	public DistinctNode(QueryTreeNode n, List<Attribute> attrs, Transaction tx) {
		this.n = n;
		this.tx = tx;
		this.attrs = attrs;
	}
	
	@Override
	public Scanner open() {
		return new DistinctScanner(n.open(), attrs);
	}

	@Override
	public int blockAccessed() {
		return n.blockAccessed();
	}

	@Override
	public int distinctSize(Attribute attr) {
		return n.distinctSize(attr);
	}

	@Override
	public Schema getSchema() {
		return n.getSchema();
	}

	@Override
	public int outputSize() {
		return n.outputSize();
	}

}
